# Maintainer: Leonardo Arena <rnalrd@alpinelinux.org>
pkgname=py3-tappy
_pkgname=tap.py
pkgver=3.1
pkgrel=3
pkgdesc="Python3 Test Anything Protocol (TAP) tools"
url="https://github.com/python-tap/tappy"
arch="noarch"
license="BSD-2-Clause"
depends="python3"
makedepends="py3-babel py3-gpep517 py3-setuptools py3-wheel"
subpackages="$pkgname-pyc"
source="$pkgname-$pkgver.tar.gz::https://files.pythonhosted.org/packages/source/t/tap.py/tap.py-$pkgver.tar.gz"
builddir="$srcdir/$_pkgname-$pkgver"

replaces="py-tappy" # Backwards compatibility
provides="py-tappy=$pkgver-r$pkgrel" # Backwards compatibility

build() {
	gpep517 build-wheel --wheel-dir .dist --output-fd 3 3>&1 >&2
}

check() {
	python3 -m venv --clear --without-pip --system-site-packages .testenv
	.testenv/bin/python3 -m installer .dist/*.whl
	.testenv/bin/python3 -m tap
}

package() {
	python3 -m installer -d "$pkgdir" .dist/*.whl
}

sha512sums="
4a3b5c5fb54ee1343cfee9bc154e812066d745c020a2c3391761c3e407b7b8428412c799df4963a385e4563ffe3b31e16055cb76ab5940ab6156e57dcf4a4d3a  py3-tappy-3.1.tar.gz
"
